package day_09;

public class GoddsTest {
    public static void main(String[] args) {
        //创建数组
        Goods[] arr=new Goods[3];
        //创建对象
        Goods g1=new Goods("001","华为手机",5888,50);
        Goods g2=new Goods("002","小米手机",4888,60);
        Goods g3=new Goods("003","荣耀手机",3888,70);
        //将对象存入数组
        arr[0]=g1;
        arr[1]=g2;
        arr[2]=g3;
        //显示信息
        for (int i = 0; i <= 2; i++) {
            Goods goods=arr[i];
            System.out.println(goods.getId()+','+goods.getName()+','+goods.getPrice()+','+goods.getCount());


        }

    }

}
